//开发环境域名+图片地址
var develop_host = 'https://a8-domain.pagoda.com.cn:11046/';
var develop_resource = 'https://a8-domain.pagoda.com.cn:11052/miResourceMgr';
//UAT环境域名+图片地址
var uat_host = 'https://a8-domain.pagoda.com.cn:14046/';
var uat_resource = 'https://a8-domain.pagoda.com.cn:14052/miResourceMgr';
//线上环境域名+图片地址
var master_host = 'https://pagoda-buy-acc.pagoda.com.cn:11521/';
var master_resource = 'http://pagoda-fastdfs.pagoda.com.cn:10501/miResourceMgr';
//默认是线上
var host = master_host;
var resource = master_resource;

//定义一些api
var category_api = 'api/v1/discovery/channel/list';
var list_api = 'api/v1/discovery/article/list';
var author_list_api = 'api/v1/discovery/author/detail';
var detail_api = 'api/v1/discovery/article/detail/-1/';
var comment_api = 'api/v1/discovery/comment/list';

//定义方法
function getHost() {  
	//点击运行编译出来的代码是开发环境
	if (process.env.NODE_ENV === 'development') {
		console.log('您已经进入【开发环境】')
		host = develop_host;
	}
	//点击发行编译出来的代码是生产环境
	else if (process.env.NODE_ENV === 'production') {
		console.log('您已经进入【生产环境】')
		host = master_host;
	}
	//h5平台需要代理才能访问
	// #ifdef  H5
	host = '' ;
	console.log('当前是h5平台，采用代理模式')
	// #endif
	console.log('getHost host='+host)
    return host;  
};  
function getResource() {  
	//点击运行编译出来的代码是开发环境
	if (process.env.NODE_ENV === 'development') {
		resource = develop_resource;
	}
	//点击发行编译出来的代码是生产环境
	else if (process.env.NODE_ENV === 'production') {
		resource = master_resource;
	}
	console.log('getResource resource='+resource)
    return resource;  
}; 
function getCategory() {  
    return category_api;  
}; 
function getList() {  
    return list_api;  
}; 
function authorList() {  
     return author_list_api;  
};  
function getDetail() {  
    return detail_api;  
}; 
function getComment() {  
     return comment_api;  
};  
 
//对外提供的方法
export default {  
    getHost:getHost(),  
	getResource:getResource(),
    getCategory:getCategory(),  
    getList:getList(),
	authorList:authorList(),
	getDetail:getDetail(),
	getComment:getComment(),
} 